

/**
 * @author Administrator
 *
 */
import java.awt.*;
import java.awt.event.*;
import java.net.*;
import java.util.*;
import javax.swing.*;

public class ToolBar extends Box {
	public ArrayList<JButton> toolButtonList; 
  ToolBar(ToolList actions) {
    super(BoxLayout.Y_AXIS);
    ToolListIterator iter = actions.iterator();
    toolButtonList = new ArrayList<JButton>();
    while(iter.hasNext()) {
      Action a = (Action) iter.next();
      JButton button = new JButton((Icon) a.getValue(Action.DEFAULT));
      toolButtonList.add(button);
      button.setToolTipText((String) a.getValue(Action.SHORT_DESCRIPTION));
      button.addActionListener(a);
      add(button);
    }
//    add(Box.createVerticalGlue());
  }
  public void addItem(ToolListener item){
	  Action a = (Action) item;
	  JButton button = new JButton((Icon) a.getValue(Action.DEFAULT));
      button.setToolTipText((String) a.getValue(Action.SHORT_DESCRIPTION));
      button.addActionListener(a);
      add(button);
//      add(Box.createVerticalGlue());
  }
  public ArrayList<JButton> getToolButtonList()
  {
	  return(toolButtonList);
  }

} 
